import {useEffect, useState} from "react";
import {getChannelsList} from "@/api/article";

const useChannel = () => {
    const [channelList, setChannelList] = useState([])
    useEffect(() => {
        getChannelsList().then(res => {
            setChannelList(res.data.channels)
        })
        // 2. 调用实例方法 完成回填
    }, [])
    return {
        channelList
    }
}

export default useChannel